﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ChannelJsonConvet
{
    /// <summary>
    /// AreasWnd.xaml 的交互逻辑
    /// </summary>
    public partial class AreasWnd : Window
    {
        public AreasData m_data = null;
        public AreasWnd(string channelName)
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            m_data = new AreasData();
            InitializeComponent();
            label_ChannelName.Content = channelName;
        }

        public AreasWnd(AreasData data,string channelName)
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            m_data = data;
            InitializeComponent();
            label_ChannelName.Content = channelName;
            textBox_old.Text = m_data.ids;
            textBox_new.Text = m_data.open_version;
        }
        private void button_Cancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void button_Save_Click(object sender, RoutedEventArgs e)
        {
            m_data.ids = textBox_old.Text;
            m_data.open_version = textBox_new.Text;

            this.DialogResult = true;
        }
    }
}
